Skip to content

Spark - Fix flaky time dependent test in remove orphan files#4859

Merged
rdblue merged 1 commit intoapache:masterfrom
kbendick:kb-fix-flakey-remove-orphan-files
May 27, 2022
Merged

Spark - Fix flaky time dependent test in remove orphan files#4859
rdblue merged 1 commit intoapache:masterfrom
kbendick:kb-fix-flakey-remove-orphan-files

Conversation

@kbendick
Copy link
Copy Markdown
Contributor

@kbendick kbendick commented May 24, 2022

This closes issue #4856

We have observed this test causing CI to fail due to timestamp precision issues (and time being relative).

Instead of adding additional busy waiting (and extending CI time), this PR updates the creation time that orphan files need to be older than 5 seconds into the future, to ensure that all orphan files are removed even if some of them wind up with a timestamp that's somewhat wonky due to timestamp precision issues.

This should ensure that all files are written with timestamps prior to the olderThan timestamp.

cc @RussellSpitzer @singhpk234

@github-actions github-actions bot added the spark label May 24, 2022
@kbendick kbendick force-pushed the kb-fix-flakey-remove-orphan-files branch from eb387fa to 27f8b2d Compare May 24, 2022 21:36
DeleteOrphanFiles.Result result = SparkActions.get().deleteOrphanFiles(table)
.executeDeleteWith(executorService)
.olderThan(System.currentTimeMillis())
.olderThan(System.currentTimeMillis() + 5000) // Ensure all orphan files are selected
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where we are going, we don't need roads.

@rdblue rdblue merged commit 35aa9fe into apache:master May 27, 2022
@rdblue
Copy link
Copy Markdown
Contributor

rdblue commented May 27, 2022

Thanks, @kbendick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants